//判断1-100之间有多少个质数并输出所有质数。

public class Demo2 {
	public static void main(String[] args) {
		int count = 0;
		for (int i = 2; i <= 100; i++) {
			int j = 2;
			while (i % j != 0) {
				j++;
			}
			if (j == i) {
				System.out.println(i);
				count++;
			}
		}
		System.out.println("共有" + count + "个质数");
	}
}
